<template>
    <div class="td-form">
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="纠错" name="1">
                <form-edit @cancel="cancel"></form-edit>
            </el-tab-pane>
            <el-tab-pane label="添加" name="2">
                <form-add 
                    :types="types"
                    @cancel="cancel"
                ></form-add>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
import formEdit from './edit.vue'
import formAdd from './add.vue'

export default {
    head: {
    },
    props:{
        types: {
            type: Array,
            default: () => [],
        },
    },
    components: { 
        formEdit,
        formAdd
    },
    data: () => ({
        currentTitleInd:0,
        activeName:'1'
    }),
    methods: {
        cancel(){
            this.$emit('cancel')
        }

    },
    computed: {
        
    },
    mounted() {

    },
    beforeDestroy() {

    },
}
</script>

<style lang="scss" scoped>
    @import '@css/var.scss'; 
    .td-form {
        margin-top: -20px;
        
        ::v-deep .el-tabs__item {
            line-height: 20px;
        }
    }
</style>
 